Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add backtracking loops, backreferences, and if-then-else constructs to Regex "simplified" code gen #61906

Merged
merged 9 commits into from
Nov 23, 2021

Conversation

stephentoub
Copy link
Member

Contributes to #61902

Adds support to our "simplified" Regex codegen for backtracking loops, backreferences, and both if-then-else constructs.

cc: @joperezr

@ghost
Copy link

ghost commented Nov 22, 2021

Tagging subscribers to this area: @eerhardt, @dotnet/area-system-text-regularexpressions
See info in area-owners.md if you want to be subscribed.

Issue Details

Contributes to #61902

Adds support to our "simplified" Regex codegen for backtracking loops, backreferences, and both if-then-else constructs.

cc: @joperezr

Author: stephentoub
Assignees: -
Labels:

area-System.Text.RegularExpressions

Milestone: -

@@ -74,6 +74,7 @@ internal abstract class RegexCompiler
private static readonly MethodInfo s_stringIndexOfCharInt = typeof(string).GetMethod("IndexOf", new Type[] { typeof(char), typeof(int) })!;
private static readonly MethodInfo s_stringLastIndexOfCharIntInt = typeof(string).GetMethod("LastIndexOf", new Type[] { typeof(char), typeof(int), typeof(int) })!;
private static readonly MethodInfo s_textInfoToLowerMethod = typeof(TextInfo).GetMethod("ToLower", new Type[] { typeof(char) })!;
private static readonly MethodInfo s_arrayResize = typeof(Array).GetMethod("Resize")!.MakeGenericMethod(typeof(int));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmm interesting, I would have expected this to trigger a linker warning since the place using this is not annotated as RequiresUnreferencedCode cc: @eerhardt

@ghost ghost locked as resolved and limited conversation to collaborators Dec 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants